//package com.yty.order.config;
//
//import com.yty.order.service.IAccountInfoService;
//import com.yty.order.service.IDeDuplicationService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQReplyListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//@Component
//@RocketMQMessageListener(topic = "send_message_topic",consumerGroup = "consumer_txmsg_group_bank2")
//@Slf4j
//public class TxmsgConsumer implements RocketMQReplyListener {
//
//    @Autowired
//    IAccountInfoService accountInfoService;
//    @Autowired
//    IDeDuplicationService deDuplicationService;
//
//    @Override
//    public Object onMessage(Object message) {
//        log.info("开始消费消息，消费信息为:{}",message);
//        return true;
//    }
//
////    @Override
////    public Object onMessage(Object message) {
////        log.info("开始消费消息，消费信息为:{}",message);
////        //解析消息为对象
////        AccountInfo accountInfo = JSONObject.toJavaObject(JSONObject.parseObject(message.toString()), AccountInfo.class);
////        try {
////            //调用service增加账号金额
////            accountInfoService.addAccountInfoBalance(accountInfo);
////            //添加事务记录
////            deDuplicationService.insertDeDuplicationLog(accountInfo.getTxNo(),true,"操作成功");
////            return true;
////        }catch (Exception e){
////            deDuplicationService.insertDeDuplicationLog(accountInfo.getTxNo(),false,e.getMessage());
////            log.error("消费信息为失败:",e);
////        }
////        return false;
////    }
//}
